
import java.io.File;
import java.util.ArrayList;

public class Main {

    @SuppressWarnings({"unchecked", "rawtypes"})
    public static void main(String[] args) {

        System.out.println("experiment_id\t" + Params.EXPERIMENT_ID);

        if (Params.N_TIMES) {
            System.out.println("ALPHA\tGAMMA\tAVG\t\tAL\t\tAM\t\tBL\t\tBM");
        }

        int experiments = 30;

        float alpha = 0;
        float gamma = 0;
        for (int i = 0; i < experiments; i++) {
//            for (alpha = 0.8f; alpha <= 0.89; alpha += 0.01) {
//                for (gamma = 0.9f; gamma <= 1; gamma += 0.01) {
//                    Params.QL_ALPHA = alpha;
//                    Params.QL_GAMMA = gamma;
            //---------------------------------------------------------------------
                    //Create the traffic network
//                System.out.print("Creating traffic network... ");
                    Graph G = ProcessFiles.processGraph(new File("files/2ortuzar.net.xml"));
//                System.out.println("done!");
                    //G.generateGraphviz();
                    //G.print();

            //---------------------------------------------------------------------
                    //Create the drivers based on the OD-Matrix
//                System.out.print("Creating drivers... ");
                    ArrayList<QLearningDriver> D = ProcessFiles.processODMatrix(G, new File("files/ortuzar.od.xml"));
//                System.out.println("done!");
                /*for (QLearningDriver d : D) {
                     System.out.println(d);
                     }/**/

                    //Run the simulation
//                System.out.print("Running simulation... ");
                    Simulation sim = new Simulation(G, null, D);
                    if (Params.N_TIMES) {
                        System.out.print(Params.QL_ALPHA + "\t" + Params.QL_GAMMA);
                    }
                    sim.start();
//                System.out.println("done!");
//                System.out.println("\tIterations: " + sim.getIteration());
//                System.out.println("\tRuntime: " + sim.getRuntime() + "ms");/**/

                }
            }
//        }
//
//    }
}
